package auctionhaus

import com.auctionhaus.Customer

class CustomerService {
    static expose=['xfire']
    static transactional = true

    def createCustomer(String customerEmail, String password) {
        def customer = Customer.findByEmailAddress(customerEmail)
        if (!customer) {
            customer = new Customer(emailAddress: customerEmail,
                                    password: password,
                                    date: new Date(),
                                    adminRole: false).save()
        }
        return customer

    }
}
